<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%> 
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>

<html>
<%
	String basePath = "http://" + request.getLocalAddr() + ":"
			+ request.getLocalPort() + request.getContextPath();
%>
<title>${promptInfo.totalDescInfo}</title>
<head>
<script type="text/javascript">
var jsdata = {
	    globalParam:$("#actionForm").formSerialize(),
		//树是否全部展开true：展开,false:合并
		isOpen:'true',
	    //first,last
    	checkbox:{name:'全选',type:'first',width:'10%',disabled:'true'},
    	shortcut:{
    		name:'操作',
	    	url:'decorateForwardAction.action',
	    	width:'30%',
	    	event:[
    			{operate:'modify',name:'${pmsIndex.sys_org_modify.name}',disabled:'false',isvalid:'${!empty pmsIndex.sys_org_modify}',param:'code=${pmsIndex.sys_org_modify.code}'},
    			{operate:'detail',name:'${pmsIndex.sys_org_detail.name}',disabled:'false',isvalid:'${!empty pmsIndex.sys_org_detail}',param:'code=${pmsIndex.sys_org_detail.code}'},
    			{operate:'del',name:'${pmsIndex.sys_org_delete.name}',disabled:'true',isvalid:'${!empty pmsIndex.sys_org_delete}',param:'code=${pmsIndex.sys_org_delete.code}'}
	        ]
	    },
	    //父亲节点是否可操作（true：可操作 false：不可操作）
	    isParentNodeOpt:'true',
    	//列表要显示的列（在json中对应的key）
		tableShowColumn: ['orgName','orgCode'],
		//列表头显示名称
		tableColumnName:   ['机构名称','机构代码'],
		//列表头宽度
		tableColumnWidth:   ['25%','15%'],
		//可以作为主键的类，在页面传送的过程中为paramMap.key{1}(主键个数值)=value的形式
		//多个主键的时候为["orgID","orgCode"]:paramMap.key1=value&paramMap.key2=value
		primkeyColumn:["orgID"],
		//要增加链接的列，可以为多个
		tableLinkColumn:[{name:'orgName',url:'',param:''}],
		//要进行树型显示的列，支持一列
		treeShowColumn:'orgName',
		//树型菜单，起始根值
		treeNodeStartValue:'${session.s_userOrgID}',
		//属性菜单子列
		treeChildColumn:'orgID',
		//属性菜单父列
		treeParendColumn:'orgParentID',
    	ajax:{
			//ajax请求url
			url:'ajaxAction.action', 
			//ajax请求参数
			data:'code=${code}'
		}
    	//tableTreeData:eval(info)
	};
var joptions = {};
$(document).ready(function(){	
	$('#gridTree').gridTreeTB(jsdata,joptions);	
	$('#delete_org').screenTB({
			windowDocument:window.parent.document,
			width:'250',
			height:'130',
			content:'测试内容',
			contentAlign:'center',
			contentValign:'middle',
			title:'系统提示信息',
			buttonValueYes:'确定',	
			buttonValueNo:'取消',	
			dialogType:'alert',
			iframeSrc:''						
		},{
		clickEvent:function(data){
			if ($("#gridTree tbody input[type='checkbox']:checked").size() == 0){
				data = $.extend(data,{content:'请选择您要删除的机构！'})
				return false;
			}
			else{
				var orgID="";
				$("#gridTree tbody input[type='checkbox']:checked").each(function(){
                    orgID+=$(this).val()+",";
				})
				orgID = orgID.substring(0,orgID.length-1);
				window.location.href = "decorateForwardAction.action?code=${pmsIndex.sys_org_delete.code}&paramMap.orgID="+orgID;
				return true;
			}
		}
	});
});

</script>
</head>
<body >
<form name="actionForm" method="post" action="operateAction.action" id="actionForm">
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableC">
  <tr>
   <td class="tableCleft">&nbsp;</td>
   <td class="tableCcenter" align="right">
    	<table width="100%" border="0" align="center" cellpadding="4" cellspacing="1" class="SkyTableLine">
         <tr>
           <td class="SkyTDLine" align="right" style="background:#9CC7FF;height:22;" >
	 		<s:if test="pmsIndex.sys_org_create">
				<a href="decorateForwardAction.action?code=${pmsIndex.sys_org_create.code}"><img src="<%=request.getContextPath()%>/${pmsIndex.sys_org_create.icon}" align="absmiddle" width="14" border="0" height="14">${pmsIndex.sys_org_create.name}</a>
	  		</s:if>
			<s:if test="pmsIndex.sys_org_delete">
				<a id="delete_org" href="#"><img src="<%=request.getContextPath()%>/${pmsIndex.sys_org_delete.icon}" align="absmiddle" width="14" border="0" height="14">${pmsIndex.sys_org_delete.name}</a>
			</s:if>
	     </td>
           </tr>
         </table>   
      </td>
     <td class="tableCright">&nbsp;</td>
   </tr>
	<tr>
		<td class="tableCleft">&nbsp;</td>
		<td class="tableCcenter" id="gridTree" valign="top"></td>
		<td class="tableCright">&nbsp;</td>
	</tr>
</table>
</form> 
</body>
</HTML>
